Show internal wallet name for transfers between own wallets#1834
Show internal wallet name for transfers between own wallets#1834
Conversation
- Add walletId column to AddressRecord with FK to wallets table - Save sender and recipient wallet names on transfer execution - Resolve internal wallet names on confirm screen via WalletService fallback - Add internalWallet address type with wallet icon in UI
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience for transfers between a user's own wallets. By integrating Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request integrates "internal wallets" into the application's address resolution and transfer flow. It introduces a new AddressType.internalWallet and updates the AddressNameService and WalletService to support storing and retrieving internal wallet addresses, including a database migration to add a walletId to address records. The ConfirmService now leverages the WalletService to resolve internal wallet names, and the TransferExecutor automatically saves internal wallet addresses during transfer operations. UI components like ConfirmRecipientViewModel and AddressListItemViewModel have been updated to reflect this new address type. A suggestion was made to improve the readability of a switch statement in TransferExecutor.swift by using a default case.
| switch input.data.type { | ||
| case .transfer, .transferNft: | ||
| break | ||
| case .swap, .tokenApprove, .stake, .account, .perpetual, .earn, .generic, .deposit, .withdrawal: | ||
| return | ||
| } |
There was a problem hiding this comment.
For improved readability and conciseness, you can simplify this switch statement by using a default case to handle all transaction types that should cause an early return. This avoids explicitly listing all of them and makes the intent clearer.
| switch input.data.type { | |
| case .transfer, .transferNft: | |
| break | |
| case .swap, .tokenApprove, .stake, .account, .perpetual, .earn, .generic, .deposit, .withdrawal: | |
| return | |
| } | |
| switch input.data.type { | |
| case .transfer, .transferNft: | |
| break | |
| default: | |
| return | |
| } |
…-name-of-the-wallet-if-internal-transfer-between-wallets
Close: #1830